#include "GCone.h"
#include "GMath.h"

namespace GMath
{
	GCone::GCone()
	{
		Radius = 1;
		Height = 1;
		Front = GVector3::UnitZ;
		Position = GVector3::Zero;
	}

	GCone::GCone(float TheRadius, float TheHeight, const GVector3& TheFront, const GVector3& ThePosition)
	{
		Create(TheRadius, TheHeight, TheFront, ThePosition);
	}

	GCone::~GCone()
	{
	}

	void GCone::Create(float TheRadius, float TheHeight, const GVector3& TheFront, const GVector3& ThePosition)
	{
		Radius = TheRadius;
		Height = TheHeight;
		Front = TheFront;
		Position = ThePosition;
	}

	float GCone::GetArea() const
	{
		return G_PI * Radius * (Radius + GMath::SqrtF(Height * Height + Radius * Radius));
	}
	
	float GCone::GetVolume() const
	{
		return G_PI * Radius * Radius * (Height / 3.0f);
	}

}